<template>
	<view class="wrap">
		<view class="">
			<h1>{{articleDetailData.title}}</h1>
			<p style="margin-top: 5rpx;">作者：{{articleDetailData.creator}}</p>
			<p style="margin-top: 5rpx;">时间：{{articleDetailData.createDate}}</p>
		</view>
		</br>
		<u-parse :html="articleDetailData.content" :selectable="true"></u-parse>
	</view>
</template>

<script>
	import {
		getArticleDetail
	} from '@/api/article/articleDetail.js'
	import { marked } from "marked";
	export default {
		data() {
			return {
				articleDetailData: {}
			}
		},
		onLoad(option) {
			console.log('articleDetailId:' + option.id)
			this.getArticleDetail(option.id)
		},
		methods: {
			getArticleDetail(id) {
				getArticleDetail(id).then(res => {
					this.articleDetailData = res.data
					this.articleDetailData.content = marked(res.data.content)
				})
			}
		}
	}
</script>

<style>
.wrap {
	padding: 30rpx;
}
</style>
